How to Upgrade Odoo between Minor Versions

This article will show you how to upgrade Odoo between minor versions under a major release.

1. Check the current Odoo version

Log in to the Client Panel

Please log in to the Control Panel with your credentials. Then locate your target deployment on the Home page or the My Applications page.

Click the "Manage" button on the Home page or the My Applications pgae, followed by the “Site & SSL” tab.

Log in to Odoo

Click the domain you'd like to visit. You will be taken to the login interface. Then, input your Initial Login Email and Initial Login Password, then click Log in.

Note: It may happen when you copy and paste your login information into the field, blank space appears before your email or password. Do remember to remove the blank space, otherwise the login will fail.

Check your Odoo version

Now go to settings and scroll down to the buttom, and you will see the current Odoo version. In the example, our Odoo version is Odoo 15.0-20211116.

2. Download the target Odoo version to the /cloudclusters directory

We will download Odoo 15.0-20220925 version to the /cloudclusters directory. Here, we are presenting two methods.

Method 1

Download it directly to /cloudclusters by using the wget command in a Shell/SSH session in the control panel:

  • First, search the target version online and copy the download url.
  • Next, launch a Shell/SSH session in the control panel.
  • Last, run the following command
    wget https://nightly.odoo.com/15.0/nightly/deb/odoo_15.0.20220925.tar.xz     # downloaded URL of the target version
    
Method 2

Download a certain version to your local machine using git commands and then upload it to the /cloudclusters via the FTPS service.

   mv odoo odoo.old
   apt update && apt install git
   git clone https://github.com/odoo/odoo --branch 15.0 --depth=1

In this example, we have downloaded the Odoo 15. Please replace the version number with your target version. You can see all of the Odoo branches at https://github.com/odoo/odoo.

3. Extract the downloaded file

Please do backup your Odoo directory before continuing. This is so that you can restore to this backup in case the upgrade fails.

Extract the downloaded file under the /cloudclusters directory and name it Odoo.

  • If it's a tar file, use

    tar -xvf `file-name` -C /cloudclusters 
    
  • If it's a zip file, use

    unzip `file-name` -d /cloudclusters
    

4. Prepare the Virtual Environment and Install Python

Prepare a virtual environment

cd /cloudclusters
virtualenv -p python3 odoo/venv

Enter the virtual environment

source odoo/venv/bin/activate

Install dependencies

pip3 install -r odoo/requirements.txt
pip3 install psycopg2-binary
pip3 install requests

Deactivate the virtual environment

deactivate odoo/venv/bin/activate

Update permission

chown -R odoo:odoo /cloudclusters/odoo && chmod -R 755 /cloudclusters/odoo

Synchronous the directories of the older Odoo to the new one. If you have customized directories, please also synchronous them to the new odoo's.

Take the following two commonly used directories for example: /cloudclusters/odoo/filestore and /cloudclusters/odoo/odoo/addons.

Back up the addons under the new Odoo directory.
mv /cloudclusters/odoo/odoo/addons /cloudclusters/odoo/odoo/addons.bak
Copy the old Odoo directories to the new ones.
cp -a /cloudclusters/odoo.old/filestore   /cloudclusters/odoo
cp -a /cloudclusters/odoo.old/odoo/addons  /cloudclusters/odoo/odoo/
Update the perssion again
chown -R odoo:odoo /cloudclusters/odoo && chmod -R 755 /cloudclusters/odoo
Restart Odoo
supervisorctl restart all

5. Possible Errors During the Upgrade and Solutions

Error 1

It shows Internal Server Error when you log in to your Odoo website. This is normally caused by different Python packages and can happen when you upgrade from Odoo-15.0-20211116(Community Edition) to Odoo15.0-20220925(Community Edition).

Troubleshooting

Use the following command to check the logs under /var/log/supervisor/odoo.log to see if there is anything wrong. From this log, we can see 'html2text' is missing.

tail -n 100 /var/log/supervisor/odoo.log

Solution Download this missing item.

Go to the Python virtual environment and get html2text by using the following commands.

source odoo/venv/bin/activate
pip3 install html2text

Next, exit the virtual environment after the download

deactivate odoo/venv/bin/activate

Then, update Permission

chown -R odoo:odoo /cloudclusters/odoo && chmod -R 755 /cloudclusters/odoo

Last, restart Odoo

supervisorctl restart all

Error 2

Errors can also be caused by the different Python versions between two Odoo versions. This error can be seen when you upgrade from Odoo-15.0-20211116(Community Edition) to Odoo15.0-20220220(Community Edition).

Troubleshooting

Use the following command to check the logs under /var/log/supervisor/odoo.log to see if there is anything wrong. The screenshot shows that there is an update to module lib in the new python package.

tail -n 100 /var/log/supervisor/odoo.log

Solution

Update the Python package.

Go to the Python virtual environment and upgrade the Python package

source odoo/venv/bin/activate
pip install pyOpenSSL --upgrade
pip install cryptography --upgrade

After that, exit the virtual environment after the upgrade

deactivate odoo/venv/bin/activate

Next, update Permission

chown -R odoo:odoo /cloudclusters/odoo && chmod -R 755 /cloudclusters/odoo

Then, restart Odoo

supervisorctl restart all

6. Confirm a successful upgrade

Log in to your Odoo and go to settings to check if the Odoo has been upgraded to the target version.

That's it. You've successfully upgraded to the target Odoo version.

Copyright © 2021 Cloud Clusters Inc. all right reserved,powered by GitbookRevised on 02/08/2023

results matching ""

    No results matching ""